package com.lgj.springboot_lgj.utils;

public class ResultUtil {
    private ResultUtil() {
    }

    public static Result success() {
        return new Result(ResultStatus.SUCCESS);
    }

    public static Result success(Object data) {
        return new Result(ResultStatus.SUCCESS, data);
    }

    public static Result error() {
        return new Result(ResultStatus.ERROR);
    }

    public static Result error(Object data) {
        return new Result(ResultStatus.ERROR, data);
    }

    public static Result error(ResultStatus resultStatus) {
        return new Result(resultStatus);
    }

    public static Result error(ResultStatus resultStatus, Object data) {
        return new Result(resultStatus, data);
    }
    public static Result error(String message){
        return new Result(0,message);
    }


    public static Result errorDelete() {
        return new Result(ResultStatus.SPECIFIED_QUESTIONED_ADNIN_FORBID_DEL);
    }
    public static Result noExist(){
        return new Result(ResultStatus.SPECIFIED_QUESTIONED_CONFIG_NOT_EXIST);
    }
    //用户不存在
    public static Result errorUser(){
        return new Result(ResultStatus.USER_LOGIN_ERROR);
    }
    //咨询信息不存在
    public static Result articleNotExist(){
        return new Result(ResultStatus. SPECIFIED_QUESTIONED_ARTICLE_NOT_EXIST);
    }
    //轮播图不存在
    public static Result carouselNotExist(){return new Result(ResultStatus.SPECIFIED_QUESTIONED_CAROUSEL_NOT_EXIST);}
    public static Result category_error(){return new Result(ResultStatus.DELETE_CATEGORY_ERROR);}


}
